<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!-- 开发环境版本，包含了有帮助的命令行警告 -->
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<title></title>
		<style>
			.box{
				width: 100px;
				height: 100px;
				background: green;
			}
			.red{
				
				background: red;
			}
			.bigbox{
				width: 200px;
				height: 200px;
			}
			
		</style>
		<div id="app">
			<div v-bind:class="classObj" @click="change()">
			</div></br>
		</div>
	</head>
	<body>
		<script>
			new Vue({
				el:"#app",
				data:{
					normal:true,
					big:false
				},
				computed:{
					//classObj是一个方法
					
					classObj:function(){
						return{
							box:true,
							red:!this.normal,
							bigbox:this.big
						}
					}
				},
				
				methods:{
					change:function(){
					this.normal=!this.normal
					this.big=!this.big
					}
				}
			})
			
		</script>
	</body>
</html>
